package org.quadraspace.model;

import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.Set;

import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlElementWrapper;
import javax.xml.bind.annotation.XmlTransient;

@Entity
public class EventData {

	@Id
	@GeneratedValue
	private Long theId;

	@XmlTransient
	public Long getTheId() {
		return theId;
	}

	public void setTheId(Long theId) {
		this.theId = theId;
	}

	@OneToMany(cascade=CascadeType.ALL,fetch=FetchType.EAGER)
	Set<EventChannel> channels = new HashSet<EventChannel>();
	{
		channels.add(new EventChannel());
	}
	@XmlElementWrapper(name = "channels")
	@XmlElement(name = "channel")
	public Set<EventChannel> getChannels() {
		return channels;
	}

	public void setChannels(Set<EventChannel> _ch) {
		channels = _ch;
	}
}